
package com.tjtt.tdm.base;

/**
 * 分页抽出来的分页bean
 * @author Andrew
 */
public class PagingBean
{
	public static Integer DEFAULT_PAGE_SIZE = Integer.valueOf(25);
	public static final int SHOW_PAGES = 6;
	/**开始索引*/
	public long start;
	/**每页显示的数量*/
	private long limit;
	/**总数量*/
	private long totalCount;
	/**排序方式*/
	private String sort;
	/**排序字段*/
	private String dir;
	public PagingBean(long start, long limit, long totalCount, String sort, String dir) {
		super();
		this.start = start;
		this.limit = limit;
		this.totalCount = totalCount;
		this.sort = sort;
		this.dir = dir;
		if (start > totalCount) {
			start = totalCount - (totalCount % limit);
		}
	}

	public long getStart() {
		return start;
	}

	public void setStart(long start) {
		this.start = start;
	}

	public long getLimit() {
		return limit;
	}

	public void setLimit(long limit) {
		this.limit = limit;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getDir() {
		return dir;
	}

	public void setDir(String dir) {
		this.dir = dir;
	}

}
